package com.zzw.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

//create table share_radio
//(
//    id               bigint primary key auto_increment comment 'id',
//    agent_id         int            not null comment '主体id',
//    parent_id        int comment '上级id',
//    received_ratio   decimal(5, 2)  not null comment '分润比例(上级分给自己的比例)',
//    distribute_radio decimal(5, 2)           default 0.00 not null comment '分润比例(自己分给下级团队的比例)',
//    status           enum ('1','2') not null comment '状态(1生效 2停用)',
//    update_time      timestamp      not null default current_timestamp on update current_timestamp comment '更新时间',
//    create_time      timestamp      not null default current_timestamp comment '创建时间'
//);
public class ShareRadio extends BasicEntity {
    /**
     * 主键id
     */
    private Integer id;
    /**
     * 主体id
     */
    private Integer agentId;
    /**
     * 上级id
     */
    private Integer parentId;
    /**
     * 分润比例(上级分给自己的比例)
     */
    private BigDecimal receivedRatio;
    /**
     * 分润比例(自己分给下级团队的比例)
     */
    private BigDecimal distributeRadio;
    /**
     * 状态(1生效 2停用)
     */
    private String status;
    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAgentId() {
        return agentId;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public BigDecimal getReceivedRatio() {
        return receivedRatio;
    }

    public void setReceivedRatio(BigDecimal receivedRatio) {
        this.receivedRatio = receivedRatio;
    }

    public BigDecimal getDistributeRadio() {
        return distributeRadio;
    }

    public void setDistributeRadio(BigDecimal distributeRadio) {
        this.distributeRadio = distributeRadio;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "ShareRadio{" +
                "id=" + id +
                ", agentId=" + agentId +
                ", parentId=" + parentId +
                ", receivedRatio=" + receivedRatio +
                ", distributeRadio=" + distributeRadio +
                ", status='" + status + '\'' +
                ", updateTime=" + updateTime +
                ", createTime=" + createTime +
                '}';
    }
}
